package com.example;

public class SubStringTest {
    public static void main(String[] args) {
        String str = "abc";
        // Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -7
        String subStr = str.substring(10);

        String str2 = "hello";
        // Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 10
        String subStr2 = str2.substring(2, 10);
    }
}
